package com.tony.controller;

import com.alibaba.fastjson.JSON;
import com.tony.po.TonyInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;

@Controller
@RequestMapping("/")
public class TestA {
    @Value("${serviceA.sysInfo}")
    private String sysInfo;
    @Autowired
    private TonyInfo tonyInfo;

    @RequestMapping("show")
    @ResponseBody
    public String show(){
        return sysInfo;
    }

    @RequestMapping("tony")
    @ResponseBody
    public String tony() throws UnsupportedEncodingException {
        return JSON.toJSONString(tonyInfo);
    }

}
